#!/bin/bash

osc r --csv openEuler:Factory --repo=standard_aarch64 --arch=aarch64 | grep "blocked" | awk -F ';' '{print $1}' > blk_pkglist

for name in `cat blk_pkglist`
do
	rm -f list > /dev/null
	osc r openEuler:Factory $name -r standard_aarch64 -a aarch64 -v | cut -d ':' -f 2 > list
	sed -i 's/,//g' list
	for n in `cat list`
	do
		#echo $n
		echo "search pkg $name blocked msg"
		echo $n >>blk
	done
done
rm -f list>/dev/null

# printf blocked pkgname appear number
echo "\tblocked_number\tpkgname"
cat blk | sort | uniq -c | sort -k1,1nr | head -10
